home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / unix / volume7 / elm_update / part2 < prev    next >
Encoding:
Internet Message Format  |  1986-11-30  |  40.7 KB

  1. Subject:  v07i019:  Elm Update Kit, Part02/03
  2. Newsgroups: mod.sources
  3. Approved: mirror!rs
  4.  
  5. Submitted by: Dave Taylor <taylor@hplabs.HP.COM>
  6. Mod.sources: Volume 7, Issue 19
  7. Archive-name: elm_update/Part02
  8.  
  9. [  The shell scripts in this posting should be run on a clean copy of
  10.    the ELM sources.  Then run the "Configure.sh" script now provided,
  11.    to build the Makefiles, etc.  I suppose this is a good time to say
  12.    that Dave said to ignore errors in unpacking Part 12 of the Volume
  13.    6 ELM distribution.  -- r$  ]
  14.  
  15. #!/bin/sh
  16. # This is a shell archive.  Remove anything before this line,
  17. # then unpack it by saving it in a file and typing "sh file".
  18. # Wrapped by mirror!rs on Wed Sep  3 10:19:36 EDT 1986
  19.  
  20. # Exit status; set to 1 on "wc" errors or if would overwrite.
  21. STATUS=0
  22. # Contents:  Edit2
  23.  
  24. echo x - Edit2
  25. if test -f Edit2 ; then
  26.     echo Edit2 exists, putting output in $$Edit2
  27.     OUT=$$Edit2
  28.     STATUS=1
  29. else
  30.     OUT=Edit2
  31. fi
  32. sed 's/^XX//' > $OUT <<'@//E*O*F Edit2//'
  33. XX: Use /bin/sh
  34.  
  35. XX# This is the automatically generated output of the AUTODIFF program after
  36. XX# being run on the two directories;
  37. XX#    Old Directory: Elm-Posted
  38. XX#    New Directory: Elm
  39.  
  40. XX# Any problems with execution of this script should be reported to the 
  41. XX#     author of the program, Dave Taylor, at "hplabs!taylor".  Thanks
  42.  
  43. XX# first off, let's make sure we're running in SH
  44.  
  45. XXexport PATH || (sh $0; exit $$)
  46.  
  47. XX# next, let's ensure the user has "ed"...
  48.  
  49. XXif [ ! -f /bin/ed ]
  50. XXthen
  51. XX  echo I can\'t find /bin/ed\!
  52. XX  exit 1
  53. XXfi
  54.  
  55. XX# finally, let's get this show on the road!!
  56.  
  57. XX#---------------------------------
  58. XX# File Elm/src/Makefile.mstr is new!
  59.  
  60. XXecho File Elm/src/Makefile.mstr is new - extracting...
  61. XXif [ -f src/Makefile.mstr ]
  62. XXthen
  63. XX  echo File \'src/Makefile.mstr\' is new, but you already have something called that\!
  64. XX  echo I\'m going to move your file to \'src/Makefile.mstr.old\'...
  65. XX  /bin/mv -f src/Makefile.mstr src/Makefile.mstr.old
  66. XXelse
  67. XX  echo Extracting new file \'src/Makefile.mstr\'
  68. XXfi
  69.  
  70. XXcat > src/Makefile.mstr << 'END_OF_FILE'
  71. XX#
  72. XX#  Makefile for the ELM mail program.
  73. XX#
  74. XX#         (C) Copyright 1986, Dave Taylor
  75. XX#
  76. XX#  Last modification: March 7th, 1986
  77.  
  78. XXSHELL=/bin/sh
  79.  
  80. XX##############################
  81. XX#
  82. XX# if on a BSD system;
  83. XX#   DEFINE=-DBSD
  84. XX#   LIB2  = -lcurses
  85. XX# else if on a UTS system;
  86. XX#   DEFINE=-DUTS
  87. XX#   LIB2  = -la -lq
  88. XX# else if on a SUN system;
  89. XX#   DEFINE=-DBSD -DSUN
  90. XX#   LIB2  = -lcurses
  91. XX# else if on a Pyramid system;
  92. XX#   DEFINE=-DBSD -DNO_VAR_ARGS
  93. XX#   LIB2  = -lcurses
  94. XX# else
  95.  
  96. XX    DEFINE= >os-define<
  97. XX    LIB2  = >lib2<
  98.  
  99. XX# IF you're on an ACSnet system (Australia) then
  100. XX# you'll want to uncomment the following;
  101.  
  102. XX#   DEFINE= ${DEFINE} -DACSNET
  103.  
  104. XX##############################
  105.  
  106. XXCFILES=    addr_utils.c alias.c aliasdb.c aliaslib.c args.c bounceback.c       \
  107. XX    calendar.c connect_to.c curses.c date.c delete.c domains.c edit.c   \
  108. XX    encode.c errno.c file.c file_utils.c fileio.c hdrconfg.c help.c     \
  109. XX    initialize.c input_utils.c leavembox.c mailmsg1.c mailmsg2.c        \
  110. XX    mailtime.c mkhdrs.c elm.c newmbox.c notesfile.c options.c opt_utils.c \
  111. XX    output_utils.c pattern.c quit.c read_rc.c remail.c reply.c         \
  112. XX    return_addr.c savecopy.c screen.c showmsg.c signals.c softkeys.c    \
  113. XX    sort.c strings.c syscall.c utils.c validname.c getopt.c string2.c   \
  114. XX    builtin.c pmalloc.c
  115.  
  116. XXHEADERS=../hdrs/curses.h ../hdrs/defs.h ../hdrs/headers.h ../hdrs/sysdefs.h
  117.  
  118. XXOBJS=    addr_utils.o alias.o aliasdb.o aliaslib.o args.o bounceback.o       \
  119. XX    calendar.o connect_to.o curses.o date.o delete.o domains.o edit.o   \
  120. XX    encode.o errno.o file.o file_utils.o fileio.o hdrconfg.o help.o     \
  121. XX    initialize.o input_utils.o leavembox.o mailmsg1.o mailmsg2.o        \
  122. XX    mailtime.o mkhdrs.o elm.o newmbox.o notesfile.o options.o opt_utils.o \
  123. XX    output_utils.o pattern.o quit.o read_rc.o remail.o reply.o         \
  124. XX    return_addr.o savecopy.o screen.o showmsg.o signals.o softkeys.o    \
  125. XX    sort.o strings.o syscall.o utils.o validname.o getopt.o string2.o   \
  126. XX    builtin.o pmalloc.o
  127.  
  128. XXBIN=    ../bin
  129. XXLIBS=   -ltermcap
  130. XXCFLAGS= -O -I../hdrs
  131. XXCC=    >cc<
  132. XXRM=    >rm<
  133.  
  134. XX../bin/elm: ${OBJS} ${EXTRA} ${HEADERS} ../hdrs/elm.h
  135. XX    ${CC} -o ${BIN}/elm -n ${OBJS} ${LIBS} ${LIB2}
  136.  
  137. XX.c.o:   ${HEADERS}
  138. XX    ${CC} -c ${CFLAGS} ${DEFINE} $*.c 
  139.  
  140. XXcurses.o: curses.c ../hdrs/curses.h
  141. XX    ${CC} -c ${CFLAGS} -DRAWMODE ${DEFINE} curses.c
  142.  
  143. XX# curses.c : curses.q
  144. XX#     @../bin/quickscreen curses.q
  145. XX#
  146. XX# curses.q :
  147. XX#     @cp curses.c curses.q
  148.  
  149. XXclean:
  150. XX    ${RM} ${OBJS} LINT.OUT
  151.  
  152. XXlint: LINT.OUT
  153.  
  154. XXLINT.OUT: ${CFILES}
  155. XX    lint -p -I../hdrs ${CFILES} > LINT.OUT
  156.  
  157. XXlisting: LISTING
  158.  
  159. XXLISTING: Makefile INDEX ${HEADERS} ${CFILES}
  160. XX    @echo adding file 'Makefile'...
  161. XX    @/bin/echo \\f > LISTING
  162. XX    @cat Makefile >> LISTING
  163. XX    @echo adding file 'INDEX'...
  164. XX    @/bin/echo \\f >> LISTING
  165. XX    @cat INDEX >> LISTING
  166. XX    @../bin/makelisting ${HEADERS} ${CFILES}
  167. XX    @echo LISTING generated.
  168.  
  169. XXindex: INDEX
  170.  
  171. XXINDEX: ${CFILES} ${HEADERS}
  172. XX    @echo Creating function definition index
  173. XX    @index *.c | sort > INDEX
  174. XX    @echo File INDEX generated
  175. XXEND_OF_FILE
  176.  
  177. XXchars=`cat src/Makefile.mstr | wc -c`
  178.  
  179. XXif [ $chars -ne 2882 ]
  180. XXthen
  181. XX  echo File damaged in transit...should be 2882 bytes, is $chars instead
  182. XX  echo  I suggest you check it closely...
  183. XXfi
  184.  
  185. XX#---------------------------------
  186. XX# File Elm/src/pmalloc.c is new!
  187.  
  188. XXecho File Elm/src/pmalloc.c is new - extracting...
  189. XXif [ -f src/pmalloc.c ]
  190. XXthen
  191. XX  echo File \'src/pmalloc.c\' is new, but you already have something called that\!
  192. XX  echo I\'m going to move your file to \'src/pmalloc.c.old\'...
  193. XX  /bin/mv -f src/pmalloc.c src/pmalloc.c.old
  194. XXelse
  195. XX  echo Extracting new file \'src/pmalloc.c\'
  196. XXfi
  197.  
  198. XXcat > src/pmalloc.c << 'END_OF_FILE'
  199. XX/**            pmalloc.c        **/
  200.  
  201. XX/** This routine contains a cheap permanent version of the malloc call to 
  202. XX    speed up the initial allocation of the weedout headers and the uuname 
  203. XX    data.  
  204.  
  205. XX      This routine is originally from Jim Davis of HP Labs, with some 
  206. XX    mods by me.
  207. XX**/
  208.  
  209. XX#include <stdio.h>
  210. XX#include "defs.h"
  211.  
  212. XXchar *pmalloc(size)
  213. XXint size; 
  214. XX{
  215. XX    /** return the address of a specified block **/
  216.  
  217. XX    static char *our_block = NULL;
  218. XX    static int   free_mem  = 0;
  219.  
  220. XX    char   *return_value;
  221.  
  222. XX    /** if bigger than our threshold, just do the real thing! **/
  223.  
  224. XX    if (size > PMALLOC_THRESHOLD) 
  225. XX       return( (char *) malloc(size));
  226.  
  227. XX    /** if bigger than available space, get more, tossing what's left **/
  228.  
  229. XX    if (size > free_mem) {
  230. XX      if ((our_block = (char *) malloc(PMALLOC_BUFFER_SIZE)) == NULL) {
  231. XX        fprintf(stderr, "\n\r\n\rCouldn't pmalloc %d bytes!!\n\r\n\r",
  232. XX            PMALLOC_BUFFER_SIZE);
  233. XX        leave();    
  234. XX          }
  235. XX      free_mem = PMALLOC_BUFFER_SIZE;
  236. XX    }
  237. XX    
  238. XX    return_value  = our_block;    /* get the memory */
  239. XX    our_block += size;        /* use it up      */
  240. XX    free_mem  -= size;        /*  and decrement */
  241.  
  242. XX    return( (char *) return_value);
  243. XX}
  244. XXEND_OF_FILE
  245.  
  246. XXchars=`cat src/pmalloc.c | wc -c`
  247.  
  248. XXif [ $chars -ne 1114 ]
  249. XXthen
  250. XX  echo File damaged in transit...should be 1114 bytes, is $chars instead
  251. XX  echo  I suggest you check it closely...
  252. XXfi
  253.  
  254. XX#-------------------------------------
  255. XX# File 'hdrs/defs.h' diffs...
  256.  
  257. XXcat << 'EOF' > hdrs/defs.h.D
  258. XX209a
  259.  
  260. XX#ifdef SHORTNAMES    /* map long names to shorter ones */
  261. XX# include <shortnames.h>
  262. XX#endif
  263. XX.
  264. XX144a
  265. XX/* some stuff for our own malloc call - pmalloc */
  266.  
  267. XX#define PMALLOC_THRESHOLD    256    /* if greater, then just use malloc */
  268. XX#define PMALLOC_BUFFER_SIZE    2048    /* internal [memory] buffer size... */
  269.  
  270. XX.
  271. XX12a
  272. XX#define KLICK        10
  273.  
  274. XX.
  275. XX11c
  276. XX#define WHAT_STRING    "@(#) Version 1.2a, patch #3 release - August, 1986"
  277. XX.
  278. XX9c
  279. XX#define VERSION        "1.2a" /* Version number!  WHAT_STRING should agree */
  280. XX.
  281. XXw
  282. XXEOF
  283.  
  284. XXchars=`cat hdrs/defs.h | wc -c`
  285.  
  286. XXif [ $chars -ne 6693 ]
  287. XXthen
  288. XX  echo Your file hdrs/defs.h has been changed\!
  289. XX  echo diffs saved as \"hdrs/defs.h.D\"
  290. XXelse
  291. XX  echo applying diffs to file hdrs/defs.h...
  292. XX  /bin/cat hdrs/defs.h.D | /bin/ed - hdrs/defs.h
  293. XXfi
  294.  
  295. XX#-------------------------------------
  296. XX# File 'hdrs/headers.h' diffs...
  297.  
  298. XXcat << 'EOF' > hdrs/headers.D
  299. XX102c
  300. XXextern int  max_headers;    /* number of headers currently allocated */
  301.  
  302. XXextern struct header_rec *header_table;
  303. XX.
  304. XX93c
  305. XXextern long size_of_pathfd;    /** size of pathfile, 0 if none **/
  306. XX.
  307. XXw
  308. XXEOF
  309.  
  310. XXchars=`cat hdrs/headers.h | wc -c`
  311.  
  312. XXif [ $chars -ne 5082 ]
  313. XXthen
  314. XX  echo Your file hdrs/headers.h has been changed\!
  315. XX  echo diffs saved as \"hdrs/headers.D\"
  316. XXelse
  317. XX  echo applying diffs to file hdrs/headers.h...
  318. XX  /bin/cat hdrs/headers.D | /bin/ed - hdrs/headers.h
  319. XXfi
  320.  
  321. XX#-------------------------------------
  322. XX# File 'hdrs/elm.h' diffs...
  323.  
  324. XXcat << 'EOF' > hdrs/elm.h.D
  325. XX107c
  326. XXint   max_headers;        /* number of headers allocated */
  327.  
  328. XXstruct header_rec *header_table;
  329. XX.
  330. XX98c
  331. XXlong size_of_pathfd;        /** size of pathfile, 0 if none **/
  332. XX.
  333. XX20a
  334. XX/******** and another string for the copyright notice            ********/
  335.  
  336. XXstatic char copyright[] = { "@(#)          (C) Copyright 1986, Dave Taylor" };
  337.  
  338. XX.
  339. XX17,18d
  340. XX15c
  341. XX/******** static character string containing the version number  *******/
  342. XX.
  343. XX13d
  344. XXw
  345. XXEOF
  346.  
  347. XXchars=`cat hdrs/elm.h | wc -c`
  348.  
  349. XXif [ $chars -ne 4889 ]
  350. XXthen
  351. XX  echo Your file hdrs/elm.h has been changed\!
  352. XX  echo diffs saved as \"hdrs/elm.h.D\"
  353. XXelse
  354. XX  echo applying diffs to file hdrs/elm.h...
  355. XX  /bin/cat hdrs/elm.h.D | /bin/ed - hdrs/elm.h
  356. XXfi
  357.  
  358. XX#---------------------------------
  359. XX# File Elm/hdrs/sysdefs.master is new!
  360.  
  361. XXecho File Elm/hdrs/sysdefs.master is new - extracting...
  362. XXif [ -f hdrs/sysdefs.master ]
  363. XXthen
  364. XX  echo File \'hdrs/sysdefs.master\' is new, but you already have something called that\!
  365. XX  echo I\'m going to move your file to \'hdrs/sysdefs.master.old\'...
  366. XX  /bin/mv -f hdrs/sysdefs.master hdrs/sysdefs.master.old
  367. XXelse
  368. XX  echo Extracting new file \'hdrs/sysdefs.master\'
  369. XXfi
  370.  
  371. XXcat > hdrs/sysdefs.master << 'END_OF_FILE'
  372. XX/**            sysdefs.h            **/
  373.  
  374. XX/**  System level, configurable, defines for the ELM mail system.  **/
  375.  
  376. XX/**  (C) Copyright 1986 Dave Taylor                                **/
  377.  
  378. XX/** Define the following if you think that the information in messages
  379. XX    that have "Reply-To:" and/or "From:" fields with addresses will
  380. XX    contain valid addressing information.  If this isn't defined, the
  381. XX    calculated return address will ALWAYS be used instead.  (note that
  382. XX    this doesn't necessarily preclude the use of G)roup replies).
  383. XX**/
  384.  
  385. XX#define USE_EMBEDDED_ADDRESSES    
  386.  
  387.  
  388. XX#define FIND_DELTA    10        /* byte region where the binary search
  389. XX                       on the path alias file is fruitless 
  390. XX                                           (can't be within this boundary)    */
  391.  
  392. XX#define MAX_HEADERS    >500<    /* max number of messages in one file!   */    
  393. XX#define MAX_SALIASES    >503<    /* number of system aliases allowed      */
  394. XX#define MAX_UALIASES    >251<    /* number of user aliases allowed      */
  395. XX#define MAX_IN_WEEDLIST >150<    /* max headers to weed out               */
  396.  
  397. XX#define MAX_HOPS    35    /* max hops in return addr to E)veryone  */
  398.  
  399. XX#define MAX_ATTEMPTS    >6<    /* #times to attempt lock file creation */
  400.  
  401. XX/** see leavembox.c to determine if this should be defined or not....The 
  402. XX    default is to NOT have it defined.
  403. XX**/
  404.  
  405. XX#define REMOVE_AT_LAST
  406.  
  407. XX#define DEFAULT_BATCH_SUBJECT  "no subject (file transmission)"
  408.  
  409. XX/** If you want to have the mailer know about valid mailboxes on the
  410. XX    host machine (assumes no delivery agent aliases) then you should
  411. XX    undefine this (the default is to have it defined)...
  412. XX**/
  413.  
  414. XX#define NOCHECK_VALIDNAME
  415.  
  416. XX/** If your machine doesn't have virtual memory (specifically the vfork() 
  417. XX    command) then you should define the following....        
  418. XX**/
  419.  
  420. XX/** #define NO_VM **/
  421.  
  422.  
  423. XX/** If you want the mailer to check the pathalias database BEFORE it
  424. XX    looks to see if a specified machine is in the L.sys database (in
  425. XX    some cases routing is preferable to direct lines) then you should
  426. XX    define the following...
  427. XX**/
  428.  
  429. XX#define LOOK_CLOSE_AFTER_SEARCH
  430.  
  431.  
  432. XX/** If you'd rather the program automatically used the 'uuname' command
  433. XX    to figure out what machines it talks to (instead of trying to get
  434. XX    it from L.sys first) then define the following...
  435. XX**/
  436.  
  437. XX#define USE_UUNAME
  438.  
  439.  
  440. XX/** If you'd like "newmail" to automatically go into background when you
  441. XX    start it up (instead of the "newmail &" junk with the process id output,
  442. XX    then define the following...
  443. XX**/
  444.  
  445. XX#define AUTO_BACKGROUND
  446.  
  447. XX/** If you'd rather your mail transport agent (ie sendmail) put the From:
  448. XX    line into the message, define the following...
  449. XX**/
  450.  
  451. XX#define DONT_ADD_FROM
  452.  
  453. XX/** If your machine prefers the Internet notation of user@host for the
  454. XX    From: line and addresses, define the following...(the default is to 
  455. XX    use this rather than the USENET notation - check your pathalias file!)
  456.  
  457. XX**/
  458.  
  459. XX#define INTERNET_ADDRESS_FORMAT
  460.  
  461. XX/** If you're on a machine that prefers UUCP to Internet addresses, then
  462. XX    define the following (the basic change is that on a machine that
  463. XX    receives messages of the form <path>!user@<localhost> the displayed
  464. XX    address will be <path>!user instead of user@<localhost>.
  465.  
  466. XX    BOGUS_INTERNET is the address that your local system appends to 
  467. XX    messages occasionally.  The algorithm is simply to REMOVE the
  468. XX    BOGUS_INTERNET string.  This is horrible.  *sigh*
  469.  
  470. XX**/
  471.  
  472. XX#define PREFER_UUCP
  473. XX#define BOGUS_INTERNET    "@hplabs.HP.COM"
  474.  
  475. XX/** If you're running ACSNET and/or want to have your domain name
  476. XX    attached to your hostname on outbound mail then you can define
  477. XX    the following (default are not defined)
  478. XX**/
  479.  
  480. XX#define USE_DOMAIN
  481. XX#define DOMAIN        "<enter your domain here>"
  482.  
  483. XX/** If you are going to be running the mailer with setgid mail (or
  484. XX    something similar) you'll need to define the following to ensure
  485. XX    that the users mailbox in the spool directory has the correct
  486. XX    group (NOT the users group)
  487. XX**/
  488.  
  489. XX#define SAVE_GROUP_MAILBOX_ID
  490.  
  491. XX/** If you want a neat feature that enables scanning of the message
  492. XX    body for entries to add to the users ".calendar" (or whatever)
  493. XX    file, define this.
  494. XX**/
  495.  
  496. XX#define ENABLE_CALENDAR
  497. XX#define dflt_calendar_file    "calendar"    /* in HOME directory */
  498.  
  499. XX/** If you want to implement 'site hiding' in the mail, then you'll need to
  500. XX    uncomment the following lines and set them to reasonable values.  See 
  501. XX    the configuration guide for more details....
  502. XX**/
  503.  
  504. XX/****************************************************************************
  505.  
  506. XX#undef    DONT_ADD_FROM        
  507.  
  508. XX#define   SITE_HIDING
  509. XX#define   HIDDEN_SITE_NAME    "fake-machine-name"
  510. XX#define   HIDDEN_SITE_USERS    "/usr/mail/lists/hidden_site_users"
  511.  
  512. XX****************************************************************************/
  513.  
  514. XX/** Do we have the 'gethostname()' call?  If not, define the following **/
  515. XX/** #define NEED_GETHOSTNAME **/
  516.  
  517. XX/** are you stuck on a machine that has short names?  If so, define the
  518. XX    following **/
  519.  
  520. XX/** #define SHORTNAMES **/
  521.  
  522. XX#define NOTES_HEADER        "/***** "
  523. XX#define NOTES_FOOTER        "/* ---------- */"
  524.  
  525. XX#ifdef BSD
  526. XX# define system_hash_file    "/usr/spool/mail/.alias_hash"
  527. XX# define system_data_file    "/usr/spool/mail/.alias_data"
  528. XX#else
  529. XX# define system_hash_file    "/usr/mail/.alias_hash"
  530. XX# define system_data_file    "/usr/mail/.alias_data"
  531. XX#endif
  532.  
  533. XX#define pathfile        "/usr/lib/nmail.paths"
  534. XX#define domains            "/usr/lib/domains"
  535.  
  536. XX#define Lsys            "/usr/lib/uucp/L.sys"
  537.  
  538. XX/** where to put the output of the elm -d command... (in home dir) **/
  539. XX#define DEBUG        "ELM:debug.info"
  540.  
  541. XX#define temp_file    "/tmp/snd."
  542. XX#define temp_mbox    "/tmp/mbox."
  543. XX#define temp_print      "/tmp/print."
  544. XX#define mailtime_file    ".last_read_mail"
  545. XX#define readmsg_file    ".readmsg"
  546. XX#define signature_file    ".signature"
  547.  
  548. XX#ifdef BSD
  549. XX# define default_editor    "/usr/ucb/vi"
  550. XX# define mailhome    "/usr/spool/mail/"
  551. XX#else
  552. XX# define default_editor    "/usr/bin/vi"
  553. XX# define mailhome    "/usr/mail/"
  554. XX#endif
  555.  
  556. XX# define default_pager    "builtin"
  557.  
  558. XX#define sendmail    "/usr/lib/sendmail"
  559. XX#define smflags        "-oi"
  560. XX#define mailer        "/bin/rmail"
  561. XX#ifdef BSD
  562. XX# define mailx        "/usr/ucb/Mail"
  563. XX#else
  564. XX# define mailx        "/usr/bin/mailx"
  565. XX#endif
  566.  
  567. XX#define helphome    "/usr/local/lib"
  568. XX#define helpfile    "elm-help.main"
  569.  
  570. XX#define elmrcfile    "/.elmrc"
  571. XX#define mailheaders    ".elmheaders"
  572. XX#define dead_letter    "Cancelled.mail"
  573.  
  574. XX#define unedited_mail    "emergency.mbox"
  575.  
  576. XX#define newalias    "newalias -q 1>&2 > /dev/null"
  577. XX#define readmsg        "readmsg"
  578.  
  579. XX#define remove        "/bin/rm -f"        /* how to remove a file */
  580. XX#define cat        "/bin/cat"        /* how to display files */
  581. XX#define uuname        "uuname"        /* how to get a uuname  */
  582. XXEND_OF_FILE
  583.  
  584. XXchars=`cat hdrs/sysdefs.master | wc -c`
  585.  
  586. XXif [ $chars -ne 6490 ]
  587. XXthen
  588. XX  echo File damaged in transit...should be 6490 bytes, is $chars instead
  589. XX  echo  I suggest you check it closely...
  590. XXfi
  591.  
  592. XX#---------------------------------
  593. XX# File Elm/hdrs/shortnames.h is new!
  594.  
  595. XXecho File Elm/hdrs/shortnames.h is new - extracting...
  596. XXif [ -f hdrs/shortnames.h ]
  597. XXthen
  598. XX  echo File \'hdrs/shortnames.h\' is new, but you already have something called that\!
  599. XX  echo I\'m going to move your file to \'hdrs/shortnames.h.old\'...
  600. XX  /bin/mv -f hdrs/shortnames.h hdrs/shortnames.h.old
  601. XXelse
  602. XX  echo Extracting new file \'hdrs/shortnames.h\'
  603. XXfi
  604.  
  605. XXcat > hdrs/shortnames.h << 'END_OF_FILE'
  606. XX/**            shortnames.h            **/
  607.  
  608. XX/** This file is from Geoff Kuenning, and will help those poor users that
  609. XX    are stuck using C compilers that don't have flexnames.   Too bad.
  610.  
  611. XX    This file has no explicit copyright.
  612.  
  613. XX**/
  614.  
  615. XX#define PutLine0        PLine0
  616. XX#define PutLine1        PLine1
  617. XX#define PutLine2        PLine2
  618. XX#define PutLine3        PLine3
  619.  
  620. XX#define add_to_table        add_2_table
  621. XX#define address1        addrs1
  622. XX#define addressII        addrsII
  623. XX#define addresses        addr_s
  624. XX#define alternate_prompt    alt_prompt
  625. XX#define alternative_addresses    alt_addrs
  626. XX#define always_leave        alw_leave
  627.  
  628. XX#define calendar_line        cal_line
  629. XX#define cancelled_msg        cncld_msg
  630. XX#define central_message_buffer    cntrl_bfr
  631. XX#define compare_dates        cmp_dates
  632. XX#define compare_headers        cmp_hdrs
  633. XX#define copy_message_across    cpy_msg_across
  634. XX#define current_record        cur_rec
  635. XX#define current_time        cur_time
  636.  
  637. XX#define define_softkeys        def_softkeys
  638. XX#define display_central_message    displ_cntrl_msg
  639. XX#define display_error        displ_error
  640. XX#define display_headers        displ_hdrs
  641. XX#define display_helpfile    dspl_helpfile
  642. XX#define display_options        displ_options
  643. XX#define display_title        displ_titles
  644. XX#define display_to        displ_to
  645.  
  646. XX#define encrypted        crypted
  647. XX#define encrypted_key        crypt_key
  648. XX#define expanded_cc        xp_cc
  649. XX#define expanded_to        xp_to
  650. XX#define expand_address        xp_addr
  651. XX#define expand_domain        xp_domain
  652. XX#define expand_env        xp_env
  653. XX#define expand_filename        xp_filename
  654. XX#define expand_group        xp_group
  655. XX#define expand_logname        xp_logname
  656. XX#define expand_site        xp_site
  657. XX#define expand_system        xp_system
  658.  
  659. XX#define filename2        fn2
  660. XX#define forward            forwrd
  661.  
  662. XX#define generate_reply_to    gen_reply_to
  663. XX#define get_return_name        g_ret_name
  664.  
  665. XX#define header_line        h_line
  666. XX#define header_page        h_page
  667. XX#define headers_per_page    h_per_page
  668. XX#define header_table        h_table
  669.  
  670. XX#define install_aliases        ins_aliases
  671.  
  672. XX#define last_line_loc        last_ln_loc
  673.  
  674. XX#define machine_group        mach_group
  675. XX#define mailbox_defined        mbox_defined
  676. XX#define mailfile_size        mfile_size
  677. XX#define message_count        msg_count
  678. XX#define message_number        msg_number
  679.  
  680. XX#define newaliases        nwaliases
  681. XX#define noptimize_return    noret_opt
  682. XX#define noptimize_usenet    nousenet_opt
  683.  
  684. XX#define optimize_and_add    opt_and_add
  685. XX#define optimize_arpa        opt_arpa
  686. XX#define optimize_cmplx_arpa    opt_cmplx_arpa
  687. XX#define optimize_return        opt_return
  688. XX#define optimize_usenet        opt_usenet
  689. XX#define optional_arg        opt_arg
  690. XX#define optionally_enter    opt_enter
  691. XX#define original_cc        orig_cc
  692. XX#define original_msg_num    orig_msg_num
  693. XX#define original_to        orig_to
  694.  
  695. XX#define parse_arguments        pars_arguments
  696. XX#define parse_arpa_from        prs_arpa_from
  697. XX#define password_entry        pw_entry
  698. XX#define pattern_enter        pat_enter
  699. XX#define pattern_match        pat_match
  700.  
  701. XX#define read_alias_files    rd_alias_files
  702. XX#define read_headers        rd_headers
  703. XX#define read_notesfile        rd_notesfile
  704. XX#define read_rc            rd_rc
  705. XX#define read_rc_file        rd_rc_file
  706. XX#define received_on_machine    rcvd_on_machine
  707. XX#define remove_all        rem_all
  708. XX#define remove_first_word    rem_1st_word
  709. XX#define remove_domains        rem_domains
  710. XX#define remove_header        rem_hdr
  711. XX#define remove_user        rem_user
  712. XX#define remove_through_ch    rem_thru_ch
  713. XX#define reply_to_everyone    repl_to_everyone
  714. XX#define resolve_received    rslv_received
  715.  
  716. XX#define show_message        shw_message
  717. XX#define show_msg        showmsg
  718. XX#define show_msg_tag        sh_msg_tag
  719. XX#define size_of_pathfd        sz_of_pathfd
  720. XX#define softkeys_off        soft_off
  721. XX#define softkeys_on        soft_on
  722. XX#define subjectbuffer        subjbuff
  723. XX#define subject_matches        subj_matches
  724. XX#define system_call        sys_call
  725. XX#define system_data        sys_data
  726. XX#define system_files        sys_files
  727. XX#define system_hash_table    sys_hash_table
  728. XX#define system_record        sys_record
  729.  
  730. XX#define tail_of_string        tl_of_string
  731. XX#define talk_to_sys        tlk_to_sys
  732. XX#define tempfile        tmpfile
  733. XX#define termcap_label        tcap_label
  734. XX#define top_of_screen_left    top_left_of_screen
  735. XX#define top_of_screen_right    top_right_of_screen
  736. XX#define translate_return    xlate_return
  737.  
  738. XX#define update_mailtime        upd_mailtime
  739. XX#define update_title        upd_title
  740. XX#define unexpanded_cc        unexp_cc
  741. XX#define unexpanded_to        unexp_to
  742.  
  743. XX#define verify_transmission    vfy_xmsn
  744.  
  745. XX#define weeding_out        wding_out
  746. XXEND_OF_FILE
  747.  
  748. XXchars=`cat hdrs/shortnames.h | wc -c`
  749.  
  750. XXif [ $chars -ne 4006 ]
  751. XXthen
  752. XX  echo File damaged in transit...should be 4006 bytes, is $chars instead
  753. XX  echo  I suggest you check it closely...
  754. XXfi
  755.  
  756. XX#-------------------------------------
  757. XX# File 'utils/arepdaemon.c' diffs...
  758.  
  759. XXcat << 'EOF' > utils/arepdaemon.D
  760. XX59,60d
  761. XX37c
  762.  
  763. XX#ifdef BSD
  764. XX# include <sys/time.h>
  765. XX#else
  766. XX# include <time.h>
  767. XX#endif
  768.  
  769. XX.
  770. XXw
  771. XXEOF
  772.  
  773. XXchars=`cat utils/arepdaemon.c | wc -c`
  774.  
  775. XXif [ $chars -ne 13380 ]
  776. XXthen
  777. XX  echo Your file utils/arepdaemon.c has been changed\!
  778. XX  echo diffs saved as \"utils/arepdaemon.D\"
  779. XXelse
  780. XX  echo applying diffs to file utils/arepdaemon.c...
  781. XX  /bin/cat utils/arepdaemon.D | /bin/ed - utils/arepdaemon.c
  782. XXfi
  783.  
  784. XX#-------------------------------------
  785. XX# File 'utils/autoreply.c' diffs...
  786.  
  787. XXcat << 'EOF' > utils/autoreply.D
  788. XX24,25d
  789. XXw
  790. XXEOF
  791.  
  792. XXchars=`cat utils/autoreply.c | wc -c`
  793.  
  794. XXif [ $chars -ne 4746 ]
  795. XXthen
  796. XX  echo Your file utils/autoreply.c has been changed\!
  797. XX  echo diffs saved as \"utils/autoreply.D\"
  798. XXelse
  799. XX  echo applying diffs to file utils/autoreply.c...
  800. XX  /bin/cat utils/autoreply.D | /bin/ed - utils/autoreply.c
  801. XXfi
  802.  
  803. XX#-------------------------------------
  804. XX# File 'utils/fastmail.c' diffs...
  805.  
  806. XXcat << 'EOF' > utils/fastmail.D
  807. XX218a
  808. XX#  endif
  809. XX.
  810. XX217a
  811. XX#  ifdef BSD4.1
  812. XX      timezone(loc_time.time_zone, the_time->tz_isdst));
  813. XX#  else
  814. XX.
  815. XX203a
  816. XX#  endif
  817. XX.
  818. XX201a
  819. XX#  ifdef BSD4.1
  820. XX    junk = (long) time((long *) 0);
  821. XX    ftime(&loc_time);
  822. XX#  else
  823. XX.
  824. XX198a
  825. XX#  endif
  826. XX.
  827. XX196a
  828. XX#  ifdef BSD4.1
  829. XX    struct timeb loc_time;    /* of course this is different! */
  830. XX#  else
  831. XX.
  832. XX32c
  833. XX# ifdef BSD4.1
  834. XX#   include <time.h>
  835. XX#   include <sys/types.h>
  836. XX#   include <sys/timeb.h>
  837. XX# else
  838. XX#   include <sys/time.h>
  839. XX# endif
  840. XX.
  841. XXw
  842. XXEOF
  843.  
  844. XXchars=`cat utils/fastmail.c | wc -c`
  845.  
  846. XXif [ $chars -ne 7799 ]
  847. XXthen
  848. XX  echo Your file utils/fastmail.c has been changed\!
  849. XX  echo diffs saved as \"utils/fastmail.D\"
  850. XXelse
  851. XX  echo applying diffs to file utils/fastmail.c...
  852. XX  /bin/cat utils/fastmail.D | /bin/ed - utils/fastmail.c
  853. XXfi
  854.  
  855. XX#-------------------------------------
  856. XX# File 'utils/newmail.c' diffs...
  857.  
  858. XXcat << 'EOF' > utils/newmail.D
  859. XX251c
  860. XX      printf(">> %s mail from %s - %s\n\r", 
  861. XX        priority? "PRIORITY" : "New", from, subject);
  862. XX.
  863. XX218c
  864. XXshow_header(priority, from, subject)
  865. XXint   priority;
  866. XX.
  867. XX136c
  868. XX          show_header(priority, from_whom, subject);
  869. XX.
  870. XX131a
  871. XX        else if (first_word(buffer,"Priority:")) 
  872. XX          priority++;
  873. XX.
  874. XX113c
  875. XX    register int subj = 0, in_header = 1, count = 0, priority=0;
  876. XX.
  877. XX29a
  878. XX#ifdef AUTO_BACKGROUND
  879. XX#include <signal.h>    /* background jobs ignore some signals... */
  880. XX#endif
  881.  
  882. XX.
  883. XX20,23d
  884. XXw
  885. XXEOF
  886.  
  887. XXchars=`cat utils/newmail.c | wc -c`
  888.  
  889. XXif [ $chars -ne 7761 ]
  890. XXthen
  891. XX  echo Your file utils/newmail.c has been changed\!
  892. XX  echo diffs saved as \"utils/newmail.D\"
  893. XXelse
  894. XX  echo applying diffs to file utils/newmail.c...
  895. XX  /bin/cat utils/newmail.D | /bin/ed - utils/newmail.c
  896. XXfi
  897.  
  898. XX#-------------------------------------
  899. XX# File 'utils/newalias.c' diffs...
  900.  
  901. XXcat << 'EOF' > utils/newalias.D
  902. XX453a
  903. XX}
  904.  
  905. XXextract_comment(comment, buffer, first, last)
  906. XXchar *comment, *buffer;
  907. XXint first, last;
  908. XX{
  909. XX    /** Buffer contains a comment, located between the first and last
  910. XX        values.  Copy that into 'comment', but remove leading and
  911. XX        trailing white space.  Note also that it doesn't copy past
  912. XX        a comma, so `unpublishable' comments can be of the form;
  913. XX        dave: Dave Taylor, HP Labs : taylor@hplabs
  914. XX        and the output will be "taylor@hplabs (Dave Taylor)".
  915. XX    **/
  916.  
  917. XX    register int loc = 0; 
  918.  
  919. XX    /** first off, skip the LEADING white space... **/
  920.  
  921. XX    while (buffer[first] == ' ') first++;
  922. XX    
  923. XX    /** now let's backup the 'last' value until we hit a non-space **/
  924.  
  925. XX    last -= 2;    /* starts at ch AFTER colon.. */
  926. XX    while (buffer[last] == ' ') last--;
  927.  
  928. XX    /** now a final check to make sure we're still talking about a 
  929. XX        reasonable string (rather than a "joe :: joe@dec" type string) **/
  930.  
  931. XX    if (first < last) {
  932. XX      /* one more check - let's find the comma, if present... */
  933. XX      for (loc=first; loc < last; loc++)
  934. XX        if (buffer[loc] == ',') {
  935. XX          last = loc-1;
  936. XX          break;
  937. XX      }
  938. XX      loc = 0;
  939. XX      while (first <= last)
  940. XX        comment[loc++] = buffer[first++];
  941. XX      comment[loc] = '\0';
  942. XX    }
  943. XX.
  944. XX311a
  945. XX      if (first_colon == -1 && string[i] == ':') {
  946. XX        first_colon = i;
  947. XX        for (last_colon=strlen(string);string[last_colon] != ':'; 
  948. XX        last_colon--) ;
  949. XX      }
  950. XX      else if (i > first_colon && i < last_colon)
  951. XX       if (string[i] == c1 || string[i] == c2)
  952. XX         buffer[j++] = string[i];
  953. XX    }
  954. XX    
  955. XX.
  956. XX308c
  957. XX    for (i = 0; string[i] != '\0' && i < LONG_STRING; i++) {
  958. XX.
  959. XX306c
  960. XX    register int i = 0, j = 0, first_colon = -1, last_colon = -1;
  961. XX.
  962. XX304c
  963. XX    /* Remove all occurances of character 'c1' or 'c2' from the string.
  964. XX       Hacked (literally) to NOT remove ANY characters from within the
  965. XX       colon fields.  This will only be used if the line contains TWO
  966. XX       colons (and comments with colons in them are the kiss of death!)
  967. XX     */
  968.  
  969. XX.
  970. XX284c
  971. XX      if (strlen(comment) > 0) {
  972. XX        fprintf(data, "%s (%s)\n", address, comment);
  973. XX        additive = (long) (strlen(comment) + 4);
  974. XX      }
  975. XX      else
  976. XX        fprintf(data, "%s\n", address, comment);
  977. XX.
  978. XX267,268c
  979. XX    /** add address + comment to datafile, incrementing offset count 
  980. XX        (bytes), then for each alias in the aliases string, add to the
  981. XX.
  982. XX263c
  983. XXchar *aliases, *comment, *address;
  984. XX.
  985. XX261c
  986. XXadd_to_table(data, aliases, comment, address, table, size)
  987. XX.
  988. XX212c
  989. XX    add_to_table(data, aliases, comment, address, table, size);
  990. XX.
  991. XX209a
  992. XX    comment[0] = '\0';    /* default to nothing at all... */
  993.  
  994. XX    if ((first=strlen(aliases)+1) < (last=(strlen(buffer) - j))) {
  995. XX      extract_comment(comment, buffer, first, last); 
  996. XX    }
  997.  
  998. XX.
  999. XX198c
  1000. XX    char comment[LONG_STRING];
  1001. XX    int  first, last, i = 0, j = 0;
  1002. XX.
  1003. XX193,195c
  1004. XX    /** break buffer down into three pieces: aliases, comment, and address.
  1005. XX        Make the appropriate entries in the table (size) 
  1006. XX    **/
  1007. XX.
  1008. XXw
  1009. XXEOF
  1010.  
  1011. XXchars=`cat utils/newalias.c | wc -c`
  1012.  
  1013. XXif [ $chars -ne 11051 ]
  1014. XXthen
  1015. XX  echo Your file utils/newalias.c has been changed\!
  1016. XX  echo diffs saved as \"utils/newalias.D\"
  1017. XXelse
  1018. XX  echo applying diffs to file utils/newalias.c...
  1019. XX  /bin/cat utils/newalias.D | /bin/ed - utils/newalias.c
  1020. XXfi
  1021.  
  1022. XX#-------------------------------------
  1023. XX# File 'utils/printmail.c' diffs...
  1024.  
  1025. XXcat << 'EOF' > utils/printmail.D
  1026. XX72,73c
  1027. XX      argv++;
  1028. XX      if (argc-1) {
  1029. XX.
  1030. XX34c
  1031. XX        argv++;
  1032. XX.
  1033. XX28c
  1034. XX    argv++;                /* get past argv[0] */
  1035. XX.
  1036. XXw
  1037. XXEOF
  1038.  
  1039. XXchars=`cat utils/printmail.c | wc -c`
  1040.  
  1041. XXif [ $chars -ne 2472 ]
  1042. XXthen
  1043. XX  echo Your file utils/printmail.c has been changed\!
  1044. XX  echo diffs saved as \"utils/printmail.D\"
  1045. XXelse
  1046. XX  echo applying diffs to file utils/printmail.c...
  1047. XX  /bin/cat utils/printmail.D | /bin/ed - utils/printmail.c
  1048. XXfi
  1049.  
  1050. XX#-------------------------------------
  1051. XX# File 'utils/readmsg.c' diffs...
  1052.  
  1053. XXcat << 'EOF' > utils/readmsg.D
  1054. XX317a
  1055. XX    if (strlen(to)      > 0) { printf("%s", to);      displayed_line++;}
  1056. XX.
  1057. XX304a
  1058. XX      to[0] = '\0';
  1059. XX.
  1060. XX301a
  1061. XX    else if (strncmp(buffer,"To: ", 3) == 0)
  1062. XX      strncpy(to, buffer, SLEN);
  1063. XX.
  1064. XX287c
  1065. XXstatic char from[SLEN], subject[SLEN], date[SLEN], to[SLEN];
  1066. XX.
  1067. XX200c
  1068. XX      if (current == read_message[current_in_queue] || list_all_messages)
  1069. XX.
  1070. XX195,196c
  1071. XX        if ((current == read_message[current_in_queue] || list_all_messages)
  1072. XX                && page_breaks && current_in_queue > 0)
  1073. XX.
  1074. XX190,193c
  1075. XX        if (! list_all_messages) {
  1076. XX          if (current == read_message[current_in_queue])
  1077. XX            current_in_queue++;
  1078. XX          if (current_in_queue >= messages) 
  1079. XX            exit(0);
  1080. XX        }
  1081. XX.
  1082. XX124c
  1083. XX    else if (*argv[0] == STAR)         /* all messages....   */
  1084. XX      list_all_messages++;
  1085. XX    else {                       /* list of nums   */
  1086. XX.
  1087. XX117c
  1088. XX    else if (! isdigit(*argv[0]) && *argv[0] != LAST_CHAR && 
  1089. XX             *argv[0] != STAR) {  
  1090. XX.
  1091. XX67a
  1092. XX        list_all_messages = 0,        /* just list 'em all??       */
  1093. XX.
  1094. XX42a
  1095. XX#define  STAR        '*'        /* char to delimit all messages...  */
  1096. XX.
  1097. XX21a
  1098. XX    Also added '*' as a flag - indicating ALL messages in the mailbox.
  1099.  
  1100. XX.
  1101. XX18c
  1102. XX    
  1103. XX.
  1104. XXw
  1105. XXEOF
  1106.  
  1107. XXchars=`cat utils/readmsg.c | wc -c`
  1108.  
  1109. XXif [ $chars -ne 9564 ]
  1110. XXthen
  1111. XX  echo Your file utils/readmsg.c has been changed\!
  1112. XX  echo diffs saved as \"utils/readmsg.D\"
  1113. XXelse
  1114. XX  echo applying diffs to file utils/readmsg.c...
  1115. XX  /bin/cat utils/readmsg.D | /bin/ed - utils/readmsg.c
  1116. XXfi
  1117.  
  1118. XX#-------------------------------------
  1119. XX# File 'utils/wnewmail.c' diffs...
  1120.  
  1121. XXcat << 'EOF' > utils/wnewmail.D
  1122. XX249c
  1123. XX    /** Try to parse the 'From:' line given... It can be in one of
  1124. XX.
  1125. XX243c
  1126. XX        printf("%sMail from %s -- %s\n", 
  1127. XX           priority? "PRIORITY ": "", from, subject);
  1128. XX.
  1129. XX208c
  1130. XXshow_header(priority, from, subject)
  1131. XXint   priority;
  1132. XX.
  1133. XX126c
  1134. XX          show_header(priority, from_whom, subject);
  1135. XX.
  1136. XX123a
  1137. XX        else if (first_word(buffer, "Priority:"))
  1138. XX          priority++;
  1139. XX.
  1140. XX103c
  1141. XX    register int subj = 0, in_header = 1, count = 0, priority = 0;
  1142. XX.
  1143. XX17a
  1144. XX#ifdef AUTO_BACKGROUND
  1145. XX#include <signal.h>    /* background jobs ignore some signals... */
  1146. XX#endif
  1147.  
  1148. XX.
  1149. XX8,11d
  1150. XXw
  1151. XXEOF
  1152.  
  1153. XXchars=`cat utils/wnewmail.c | wc -c`
  1154.  
  1155. XXif [ $chars -ne 7804 ]
  1156. XXthen
  1157. XX  echo Your file utils/wnewmail.c has been changed\!
  1158. XX  echo diffs saved as \"utils/wnewmail.D\"
  1159. XXelse
  1160. XX  echo applying diffs to file utils/wnewmail.c...
  1161. XX  /bin/cat utils/wnewmail.D | /bin/ed - utils/wnewmail.c
  1162. XXfi
  1163.  
  1164. XX#---------------------------------
  1165. XX# File Elm/utils/trim-headers is new!
  1166.  
  1167. XXecho File Elm/utils/trim-headers is new - extracting...
  1168. XXif [ -f utils/trim-headers ]
  1169. XXthen
  1170. XX  echo File \'utils/trim-headers\' is new, but you already have something called that\!
  1171. XX  echo I\'m going to move your file to \'utils/trim-headers.old\'...
  1172. XX  /bin/mv -f utils/trim-headers utils/trim-headers.old
  1173. XXelse
  1174. XX  echo Extracting new file \'utils/trim-headers\'
  1175. XXfi
  1176.  
  1177. XXcat > utils/trim-headers << 'END_OF_FILE'
  1178. XX: Use /bin/sh
  1179.  
  1180. XX# This shell script is designed to be used either to trim the 'junk' headers
  1181. XX# out of an archived/saved mailbox file or to trim the headers off a file 
  1182. XX# that is being piped to it.  The program considers the following headers
  1183. XX# to be worth saving - everything else is junked.
  1184. XX#
  1185. XX#    From <user> <date>
  1186. XX#    From: name <address>
  1187. XX#    Subject:
  1188. XX#    To: 
  1189. XX#    Cc:
  1190. XX#    Date:
  1191. XX#
  1192. XX# all others are ignored and trashed.
  1193. XX#
  1194. XX# (C) Copyright 1986, Dave Taylor
  1195.  
  1196. XX# first off, let's make the 'awk' script we'll be using...
  1197.  
  1198. XXcat << 'END_OF_AWK_SCRIPT' > /tmp/awk.$$
  1199. XXBEGIN { in_body = 1 }
  1200. XX{    if (in_body) {
  1201. XX      if ($1 == "From") in_body = 0;
  1202. XX      print $0
  1203. XX    }
  1204. XX    else if ($1 == "From:" || $1 == "Subject:" || $1 == "To:" || \
  1205. XX             $1 == "Cc:" || $1 == "Date:")
  1206. XX      print $0
  1207. XX    else if (length($0) == 0) {
  1208. XX      in_body = 1;
  1209. XX      print $0
  1210. XX    }
  1211. XX}
  1212. XXEND_OF_AWK_SCRIPT
  1213.  
  1214. XX# next let's see if we're being piped to or if we've been handed
  1215. XX# either a file name or list of file names...
  1216.  
  1217. XXif [ "$1" = "" ]
  1218. XXthen
  1219. XX  cat - | awk -f /tmp/awk.$$ | uniq
  1220. XX  rm -f /tmp/awk.$$
  1221. XXelse
  1222. XX  for filename in $*
  1223. XX  do
  1224. XX    echo filtering file $filename
  1225. XX    cat $filename | awk -f /tmp/awk.$$ | uniq > OUTFILE
  1226. XX    mv OUTFILE $filename
  1227. XX  done
  1228. XX  echo done
  1229. XXfi
  1230. XX  
  1231. XXexit 0 
  1232. XXEND_OF_FILE
  1233.  
  1234. XXchars=`cat utils/trim-headers | wc -c`
  1235.  
  1236. XXif [ $chars -ne 1201 ]
  1237. XXthen
  1238. XX  echo File damaged in transit...should be 1201 bytes, is $chars instead
  1239. XX  echo  I suggest you check it closely...
  1240. XXfi
  1241.  
  1242. XX#---------------------------------
  1243. XX# File Elm/utils/Makefile.mstr is new!
  1244.  
  1245. XXecho File Elm/utils/Makefile.mstr is new - extracting...
  1246. XXif [ -f utils/Makefile.mstr ]
  1247. XXthen
  1248. XX  echo File \'utils/Makefile.mstr\' is new, but you already have something called that\!
  1249. XX  echo I\'m going to move your file to \'utils/Makefile.mstr.old\'...
  1250. XX  /bin/mv -f utils/Makefile.mstr utils/Makefile.mstr.old
  1251. XXelse
  1252. XX  echo Extracting new file \'utils/Makefile.mstr\'
  1253. XXfi
  1254.  
  1255. XXcat > utils/Makefile.mstr << 'END_OF_FILE'
  1256. XX#
  1257. XX#  Makefile for the Elm system utilities
  1258. XX#
  1259. XX#         (C) Copyright 1986, Dave Taylor
  1260. XX#
  1261. XX#  Last modification: March 5th, 1986
  1262.  
  1263. XXSHELL=/bin/sh
  1264.  
  1265. XX##############################
  1266. XX#
  1267. XX# if on a BSD system;
  1268. XX#   DEFINE=-DBSD
  1269. XX#   LIB2  = -lcurses
  1270. XX# else if on a UTS system;
  1271. XX#   DEFINE=-DUTS
  1272. XX#   LIB2  = -la
  1273. XX# else if on a SUN system;
  1274. XX#   DEFINE=-DBSD -DSUN
  1275. XX#   LIB2  = -lcurses
  1276. XX# else if on a Pyramid system;
  1277. XX#   DEFINE=-DBSD -DNO_VAR_ARGS
  1278. XX#   LIB2  = -lcurses
  1279. XX# else
  1280.  
  1281. XX    DEFINE= >os-define<
  1282. XX    LIB2  = >lib2<
  1283.  
  1284. XX##############################
  1285.  
  1286. XXCFLAGS= -O -I../hdrs
  1287. XXCC=    >cc<
  1288. XXRM=     >rm<
  1289. XXECHO=  /bin/echo
  1290.  
  1291. XXOBJS=    ../bin/newalias ../bin/from ../bin/newmail ../bin/answer       \
  1292. XX    ../bin/printmail ../bin/fastmail ../bin/readmsg                \
  1293. XX    ../bin/checkalias ../bin/arepdaemon ../bin/autoreply ../bin/wnewmail \
  1294. XX    ../bin/messages ../bin/trim-headers
  1295.  
  1296. XXall: ${OBJS}
  1297.  
  1298. XX../bin/newalias:  ../hdrs/defs.h newalias.c ../src/validname.o \
  1299. XX    ../src/opt_utils.o
  1300. XX    ${CC} ${CFLAGS} ${DEFINE} newalias.c ../src/validname.o \
  1301. XX    ../src/opt_utils.o -o ../bin/newalias 
  1302.  
  1303. XX../bin/from: from.c ../src/opt_utils.o ../src/string2.o
  1304. XX    ${CC} ${CFLAGS} ${DEFINE} from.c ../src/opt_utils.o \
  1305. XX    ../src/string2.o -o ../bin/from
  1306.  
  1307. XX../bin/newmail: ../src/opt_utils.c newmail.c ../src/string2.o
  1308. XX    ${CC} ${CFLAGS} ${DEFINE} newmail.c \
  1309. XX    ../src/string2.o -o ../bin/newmail
  1310.  
  1311. XX../bin/wnewmail: ../src/opt_utils.c wnewmail.c ../src/string2.o
  1312. XX    ${CC} ${CFLAGS} ${DEFINE} ../src/opt_utils.o \
  1313. XX    ../src/string2.o wnewmail.c -o ../bin/wnewmail
  1314.  
  1315. XX../bin/answer: answer.c ../src/opt_utils.o
  1316. XX    ${CC} ${CFLAGS} ${DEFINE} answer.c ../src/opt_utils.o -o ../bin/answer
  1317.  
  1318. XX../bin/printmail: printmail.c ../src/opt_utils.o
  1319. XX    ${CC} ${CFLAGS} ${DEFINE} printmail.c ../src/opt_utils.o \
  1320. XX    -o ../bin/printmail
  1321.  
  1322. XX../bin/fastmail: fastmail.c 
  1323. XX    ${CC} ${CFLAGS} ${DEFINE} fastmail.c ../src/opt_utils.o \
  1324. XX    -o ../bin/fastmail
  1325.  
  1326. XX../bin/readmsg: readmsg.c ../src/getopt.o ../src/opt_utils.o
  1327. XX    ${CC} ${CFLAGS} ${DEFINE} readmsg.c ../src/getopt.o \
  1328. XX    ../src/opt_utils.o -o ../bin/readmsg
  1329.  
  1330. XX../bin/arepdaemon: arepdaemon.c
  1331. XX    ${CC} ${CFLAGS} ${DEFINE} arepdaemon.c -o ../bin/arepdaemon
  1332.  
  1333. XX../bin/autoreply: autoreply.c ../src/opt_utils.o
  1334. XX    ${CC} ${CFLAGS} ${DEFINE} autoreply.c ../src/opt_utils.o \
  1335. XX    -o ../bin/autoreply
  1336.  
  1337. XX../bin/checkalias: 
  1338. XX    @echo ': Use /bin/sh' > ../bin/checkalias
  1339. XX    @echo 'if [ "$$*" = "" ]; then' >> ../bin/checkalias
  1340. XX    @echo '  echo Usage: checkalias alias \[or aliases\]' >>  \
  1341. XX          ../bin/checkalias
  1342. XX    @echo '  exit 1' >> ../bin/checkalias
  1343. XX    @echo 'fi' >> ../bin/checkalias
  1344. XX    @echo ' '  >> ../bin/checkalias
  1345. XX    @echo 'exec elm -c $$*' >> ../bin/checkalias
  1346. XX    @chmod +x ../bin/checkalias
  1347.  
  1348. XX../bin/messages: 
  1349. XX    @echo ': Use /bin/sh'                  > ../bin/messages
  1350. XX    @echo 'if [ "$$2" != "" ]; then'         >> ../bin/messages
  1351. XX    @echo '  echo Usage: messages \{folder-name\}'  >> ../bin/messages
  1352. XX    @echo '  exit 1'                 >> ../bin/messages
  1353. XX    @echo 'fi'                     >> ../bin/messages
  1354. XX    @echo ' '                      >> ../bin/messages
  1355. XX    @echo 'if [ "$$1" = "" ]; then'         >> ../bin/messages
  1356. XX    @echo '  fname=$$MAIL'                 >> ../bin/messages
  1357. XX    @echo '  optional="in your mailbox"'          >> ../bin/messages
  1358. XX    @echo 'else'                     >> ../bin/messages
  1359. XX    @echo '  fname=$$1'                >> ../bin/messages
  1360. XX    @echo '  optional="in folder $$1"'         >> ../bin/messages
  1361. XX    @echo 'fi'                           >> ../bin/messages
  1362. XX    @echo ' '                    >> ../bin/messages
  1363. XX    @echo 'mcount=`egrep "^From " $$fname | wc -l`' >> ../bin/messages
  1364. XX    @echo ' '                    >> ../bin/messages
  1365. XX    @echo 'if [ $$mcount = 1 ];then'        >> ../bin/messages
  1366. XX    @echo '  echo There is $$mcount message $$optional' >> ../bin/messages
  1367. XX    @echo 'else'                    >> ../bin/messages
  1368. XX    @echo '  echo There are $$mcount messages $$optional' >> ../bin/messages
  1369. XX    @echo 'fi'                    >> ../bin/messages
  1370. XX    @echo ' '                    >> ../bin/messages
  1371. XX    @echo 'exit 0'                    >> ../bin/messages
  1372. XX    @chmod +x ../bin/messages
  1373.  
  1374. XX../bin/trim-headers:
  1375. XX    @cp trim-headers ../bin/trim-headers
  1376. XX    @chmod +x ../bin/trim-headers
  1377.  
  1378. XX../src/validname.o: ../src/validname.c ../hdrs/defs.h
  1379. XX    @(cd ../src; ${CC} -c ${CFLAGS} ${DEFINE} validname.c; cd ../utils)
  1380.  
  1381. XX../src/opt_utils.o: ../src/opt_utils.c ../hdrs/defs.h
  1382. XX    @(cd ../src; ${CC} -c ${CFLAGS} ${DEFINE} opt_utils.c; cd ../utils)
  1383.  
  1384. XX../src/getopt.o: ../src/getopt.c ../hdrs/defs.h
  1385. XX    @(cd ../src; ${CC} -c ${CFLAGS} ${DEFINE} getopt.c; cd ../utils)
  1386.  
  1387. XX../src/string2.o: ../src/string2.c ../hdrs/defs.h
  1388. XX    @(cd ../src; ${CC} -c ${CFLAGS} ${DEFINE} string2.c; cd ../utils)
  1389.  
  1390. XXclean:
  1391. XX    ${RM} *.o ${OBJS}
  1392.  
  1393. XXlint:
  1394. XX    lint -p -I../hdrs *.c > LINT.OUT
  1395. XXEND_OF_FILE
  1396.  
  1397. XXchars=`cat utils/Makefile.mstr | wc -c`
  1398.  
  1399. XXif [ $chars -ne 4391 ]
  1400. XXthen
  1401. XX  echo File damaged in transit...should be 4391 bytes, is $chars instead
  1402. XX  echo  I suggest you check it closely...
  1403. XXfi
  1404.  
  1405. XX#-------------------------------------
  1406. XX# File 'bin/mail.elm' diffs...
  1407.  
  1408. XXcat << 'EOF' > bin/mail.elm.D
  1409. XX16c
  1410. XX  sleep 1800
  1411. XX.
  1412. XXw
  1413. XXEOF
  1414.  
  1415. XXchars=`cat bin/mail.elm | wc -c`
  1416.  
  1417. XXif [ $chars -ne 363 ]
  1418. XXthen
  1419. XX  echo Your file bin/mail.elm has been changed\!
  1420. XX  echo diffs saved as \"bin/mail.elm.D\"
  1421. XXelse
  1422. XX  echo applying diffs to file bin/mail.elm...
  1423. XX  /bin/cat bin/mail.elm.D | /bin/ed - bin/mail.elm
  1424. XXfi
  1425.  
  1426. XX#-------------------------------------
  1427. XX# File 'Instructions' diffs...
  1428.  
  1429. XXcat << 'EOF' > Instructions.D
  1430. XX84c
  1431. XXshould say "no mail" if nothing's in your incoming mailbox, and
  1432. XX.
  1433. XX75c
  1434. XXNote: the mailer runs as setgid mail to have the ability to WRITE
  1435. XX.
  1436. XX63,73c
  1437. XX    $ make -i install
  1438. XX.
  1439. XX59,61c
  1440. XXnext, you can install all the software on your system by;
  1441. XX.
  1442. XX56,57c
  1443. XX    "answer", "arepdaemon", "autoreply", "fastmail", "from", 
  1444. XX    "elm", "newalias", "newmail", "printmail", and "readmsg".
  1445. XX.
  1446. XX40,47d
  1447. XX36,38c
  1448. XX    (if you're in "sh", you can use "> MAKELOG 2>&1" instead of ">& MAKELOG")
  1449. XX.
  1450. XX34c
  1451. XX    $ (make -i all >& MAKELOG) &
  1452. XX    $ tail -f MAKELOG
  1453. XX.
  1454. XX32c
  1455. XX    When that's done, or even if it fails (don't worry too much about it)
  1456. XX.
  1457. XX29,30c
  1458. XX    $ make documentation
  1459. XX.
  1460. XX27c
  1461. XX    $
  1462. XX.
  1463. XX25c
  1464. XX    Once you're happy with the localized files, you then need to create
  1465. XXthe documentation (so there's a bit of a catch-22 that you need to format the
  1466. XXConfiguration guide before you are happy with the localization but can't do
  1467. XXthat until you're happy with the localization...oh well).
  1468. XX.
  1469. XX23c
  1470. XX    Answer the questions of that program,, then let it create the localized
  1471. XXMakefiles and system definition files for you.  When it's done you can double
  1472. XXcheck the configuration (or customize it further) by reading the Configuration
  1473. XXGuide + editing the file "hdrs/sysdefs.h".  There are lots of neat features
  1474. XXthat are unique to this mailer - it's worth a quick perusal at least!
  1475. XX.
  1476. XX19,21c
  1477. XX    $ sh Configure.sh
  1478. XX.
  1479. XX17c
  1480. XX    $ cd <where-ever you're keeping the Elm sources>
  1481. XX.
  1482. XX13,15c
  1483. XX    There is actually really one step needed - unpack all the shar
  1484. XXfiles and then;
  1485. XX.
  1486. XX5c
  1487. XX            Last Update: July 17th, 1986
  1488. XX.
  1489. XXw
  1490. XXEOF
  1491.  
  1492. XXchars=`cat Instructions | wc -c`
  1493.  
  1494. XXif [ $chars -ne 5058 ]
  1495. XXthen
  1496. XX  echo Your file Instructions has been changed\!
  1497. XX  echo diffs saved as \"Instructions.D\"
  1498. XXelse
  1499. XX  echo applying diffs to file Instructions...
  1500. XX  /bin/cat Instructions.D | /bin/ed - Instructions
  1501. XXfi
  1502. @//E*O*F Edit2//
  1503. chmod u=rwx,g=rwx,o=rwx $OUT
  1504.  
  1505. echo Inspecting for damage in transit...
  1506. temp=/tmp/sharin$$; dtemp=/tmp/sharout$$
  1507. trap "rm -f $temp $dtemp; exit" 0 1 2 3 15
  1508. cat > $temp <<\!!!
  1509.     1469    5048   37752 Edit2
  1510. !!!
  1511. wc  Edit2 | sed 's=[^ ]*/==' | diff -b $temp - >$dtemp
  1512. if test -s $dtemp ; then
  1513.     echo "Ouch [diff of wc output]:"
  1514.     cat $dtemp
  1515.     STATUS=1
  1516. elif test $STATUS = 0 ; then
  1517.     echo "No problems found."
  1518. else
  1519.     echo "WARNING -- PROBLEMS WERE FOUND..."
  1520. fi
  1521. exit $STATUS
  1522.